package com.mujin.keji.collectionsystem.exception;

import com.mujin.keji.collectionsystem.common.ErrorEnum;

/**
 * 服务器返回的错误
 */
public class ServerException extends RuntimeException {
    private int code;
    private String msg;

    public ServerException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ServerException(ErrorEnum errorEnum) {
        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMessage();
    }

    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
}